<?php

class Con_index extends Acan{
	
	public $defaultAct='abody';
	function __construct($ainfo=null){
		parent::__construct($ainfo=null);
		$this->newup;
	}
	//后台框架
	function Act_abody(){
		$anav_data = Afunc_nav()->anav_data('asale',$this->Amode,$this->Aapp);//获取菜单
		if($this->Amode == '0'){$if_start = $this->Aapp.'-';}else{$if_start='';}
		$default_url = $if_start.'index-index';
		include $this->Atpl('public/abody');
	}
	//后台首页
	function Act_index(){
		$os = Afun_get_os();
		$datetime = Afun_get_time();
		if($_GET['do']=='phpinfo'){
			phpinfo();
			exit;
		}
		if($_POST['tomail']){
			$tomail=$_POST['tomail'];
			$toname=$_POST['toname'];
			$title=$_POST['title'];
			$body=$_POST['body'];
			$amail = Afun_mail($tomail,$toname,$title,$body);
		}

		$form_val_cache = array('atpl'=>'模板缓存','ahtml'=>'静态文件缓存','file'=>'文件缓存');
		$form_chk_cache = $apo['clear'];
		$form_chk_cache['atpl']='atpl';
		$form_val_eaccelerator = array('disk'=>'磁盘缓存','mem'=>'内存缓存');
		//--清理缓存
		if($apo['clear']){
			$Aclass_file = Afunc_file();
			//print_r($apo);
			if(!empty($apo['clear']['atpl'])){
				if($Aclass_file->armdir_child(A_ROOT.'/temp/tpl_cache/'))
					echo '清理模板成功';
			}
			if(!empty($apo['clear']['ahtml'])){
				if($Aclass_file->armdir_child(A_ROOT.'/temp/ahtml/'))
					echo '清理静态文件成功';
			}
		}
		
		include $this->Atpl();
	}
	
	function Act_linux(){
		if($_POST){
			$terminal = $_POST['terminal'];
			$msg = "命令:".$terminal.'<hr>';
			$content = '<?php'."\n";
			$content .= 'echo `'.$terminal.'`;';
			$content .= "\n".'?>';
			if(!is_dir(A_ROOT.'temp/linux/')){
				Afunc_file()->amkdirm(A_ROOT.'temp/linux/');
			}
			file_put_contents(A_ROOT.'temp/linux/terminal.php',$content);
			echo '1';
			exit;
		}
		include_once $this->Atpl();
	}
}

?>